<?php

namespace api\controller;

// +----------------------------------------------------------------------
// | 单环节集封板时间
// +----------------------------------------------------------------------

use common\controller\VerifyController;
use common\service\EpisodeStepCategorySealTimeService;
use think\Request;

class EpisodeStepCategorySealTimeController extends VerifyController
{

    public $service;

    public function __construct()
    {
        parent::__construct();
        $this->service = EpisodeStepCategorySealTimeService::getInstance();
    }

    /**
     * 单环节封板时间列表
     * @param Request $request
     * @return \think\Response
     * @throws \think\Exception
     */
    public function EpisodeStepCategoryList(Request $request)
    {
        $filter = $request->param()['param']['filter'];
        $page = $request->param()['param']['page'] ?? [1, C("database.database_max_select_rows")];
        $res = $this->service->EpisodeStepCategoryList($filter, $page, $request->getTenantId());
        return json(success_response('OK', $res));
    }

    /**
     * 设置单环节封板时间
     * @param Request $request
     * @return \think\Response
     */
    public function SetEpisodeStepCategory(Request $request)
    {
        $data = $request->param()['data'];
        $res = $this->service->SetEpisodeStepCategory($data, $request->getTenantId());
        return json(success_response('OK', $res));
    }
}
